    
	//定义时间选择器
	var handleDatetimePicker = function () {        

		//汉化时间选择器
		$.fn.datetimepicker.dates['zh-cn'] = {
			days: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"],
			daysShort: ["周日", "周一", "周二", "周三", "周四", "周五", "周六", "周日"],
			daysMin: ["日", "一", "二", "三", "四", "五", "六", "日"],
			months: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
			monthsShort: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
			today: "今日",
			suffix: [],
			meridiem: ["上午", "下午"]
		};
          $(".start_date").datetimepicker({
              format: "yyyy/mm/dd hh:ii",
			  autoclose: true,
			  language:'zh-cn',
              pickerPosition: (App.isRTL() ? "bottom-right" : "bottom-left"),
			  todayBtn: true
          });

         $(".end_date").datetimepicker({
              format: "yyyy/mm/dd hh:ii",
			  language:'zh-cn',
              autoclose: true,
              todayBtn: true,
              //startDate: "2013-02-14 10:00",
              pickerPosition: (App.isRTL() ? "bottom-right" : "bottom-left"),
              //minuteStep: 10,
          });
    }
	
	//标签
	var handleTagsInput = function () {
        if (!jQuery().tagsInput) {
            return;
        }
        $('#tags').tagsInput({
            //width: 'auto',
			width: 420,
			defaultText:"新增",
            'onAddTag': function () {
                //alert(1);
            },
        });
    }

var FormValidation = function () {


    return {
        //main function to initiate the module
        init: function () {
			
			//间接实例化时间选择器
			handleDatetimePicker();
			console.log("间接实例化时间选择器");
			
			handleTagsInput();
			console.log("间接实例化标签插件");
			/*
            var form2 = $('#form_sample_2');
            var error2 = $('.alert-error', form2);
            var success2 = $('.alert-success', form2);

            form2.validate({
                errorElement: 'span', //default input error message container
                errorClass: 'help-inline', // default input error message class
                focusInvalid: false, // do not focus the last invalid input
                ignore: "",
                rules: {
                    title: {
                        minlength: 2,
                        required: true
                    },
                },

                messages: { // custom messages for radio buttons and checkboxes
					title: {
						minlength : "用户名长度不可小于2位！",
                        required: "请填写用户名",
                    },
                },
				
				//指明错误放置的位置，默认情况是：error.appendTo(element.parent());即把错误信息放在验证的元素后面。
                errorPlacement: function (error, element) { // render error placement for each input type
  
                },

                invalidHandler: function (event, validator) { //display error alert on form submit   
                    success2.hide();
                    error2.show();
                    App.scrollTo(error2, -200);
                },

                highlight: function (element) { // hightlight error inputs
                    $(element)
                        .closest('.help-inline').removeClass('ok'); // display OK icon
                    $(element)
                        .closest('.control-group').removeClass('success').addClass('error'); // set error class to the control group
                },

                unhighlight: function (element) { // revert the change dony by hightlight
                    $(element)
                        .closest('.control-group').removeClass('error'); // set error class to the control group
                },

                // success: function (label) {
                    // if (label.attr("for") == "service" || label.attr("for") == "membership") { // for checkboxes and radip buttons, no need to show OK icon
                        // label
                            // .closest('.control-group').removeClass('error').addClass('success');
                        // label.remove(); // remove error label here
                    // } else { // display success icon for other inputs
                        // label
                            // .addClass('valid').addClass('help-inline ok') // mark the current input as valid and display OK icon
                        // .closest('.control-group').removeClass('error').addClass('success'); // set success class to the control group
                    // }
                // },

                submitHandler: function (form) {
                    success2.show();
                    error2.hide();
					form2.submit();
                },
				// $("#submit").click(function(){
					// if(form2.valid()){
						// form2.submit();
					// }
				// });

            });
			
            //apply validation on chosen dropdown value change, this only needed for chosen dropdown integration.
            $('.chosen, .chosen-with-diselect', form2).change(function () {
                form2.validate().element($(this)); //revalidate the chosen dropdown value and show error or success message for the input
            });

             //apply validation on select2 dropdown value change, this only needed for chosen dropdown integration.
            $('.select2', form2).change(function () {
                form2.validate().element($(this)); //revalidate the chosen dropdown value and show error or success message for the input
            });
			
			*/

        }

    };

}();